Skip to content

Fix API method guards#414

Open
sueun-dev wants to merge 1 commit into
duneanalytics:mainfrom
sueun-dev:fix-api-method-guards
Open

Fix API method guards#414
sueun-dev wants to merge 1 commit into
duneanalytics:mainfrom
sueun-dev:fix-api-method-guards

Conversation

@sueun-dev
Copy link
Copy Markdown

Summary

  • return immediately from API routes when the request method is not supported
  • include Allow headers for the supported methods
  • avoid calling Etherscan from /api/getContract after rejecting a non-GET request

Validation

  • reproduced the existing /api/getContract behavior: POST returned 200 and still called Etherscan
  • verified the patched behavior: unsupported methods return 405 and do not continue handler work
  • pnpm run typecheck
  • pnpm exec eslint pages/api/getContract.ts pages/api/getDynamicDoc.ts
  • pnpm exec prettier --check pages/api/getContract.ts pages/api/getDynamicDoc.ts
  • pnpm run build

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@sueun-dev is attempting to deploy a commit to the Duneanalytics Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant